/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package canteen.sys.model.entity;

import java.io.Serializable;
import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author TNT
 */
@Entity
public class EmployeeMaster implements Serializable {

    @Id
    @GeneratedValue
    private int eId;
    @NotNull
    @Column(length = 5, unique=true)
    private String eCode;
    @NotNull
    @Size(min = 2, max = 50, message = "First Name must >=2 or <=50 character")
    @Column(length = 50)
    private String eFName;
    @Column(length = 50)
    private String eMName;
    @NotNull
    @Size(min = 2, max = 50, message = "Last Name must >=2 or <=50 character")
    @Column(length = 50)
    private String eLName;
    @NotNull
    @Size(min = 20, max = 200, message = "Address1  must >=20 or <=200 character")
    @Column(length = 200)
    private String eAddress1;
    @Size(min = 20, max = 200, message = "Address2  must >=20 or <=200 character")
    @Column(length = 200)
    private String eAddress2;
    @NotNull
    private boolean eGender;
    @Digits(integer = 10, fraction = 0, message = "Home phone have 10 digit")
    @Column(length = 15)
    private String ePhoneHome;
    @NotNull
    @Digits(integer = 10, fraction = 0, message = "Mobile phone have 10 digit")
    @Column(length = 15)
    private String eMobile;
    @NotNull
    private Date eDoj;
    @NotNull
    private boolean status;
    @ManyToOne
    @JoinColumn(name = "DeptId")
    private DepartmentMaster department;
    @ManyToOne
    @JoinColumn(name = "SubDeptId")
    private SubDepartmentMaster subDepartment;
    @ManyToOne
    @JoinColumn(name = "DesgId")
    private DesignationMaster designational;
    @OneToOne
    @JoinColumn(name = "lId")
    private LoginMaster loginMaster;

    public LoginMaster getLoginMaster() {
        return loginMaster;
    }

    public void setLoginMaster(LoginMaster loginMaster) {
        this.loginMaster = loginMaster;
    }

    public EmployeeMaster(int eId, String eCode, String eFName, String eMName, String eLName, String eAddress1, String eAddress2, boolean eGender, String ePhoneHome, String eMobile, Date eDoj, boolean status, DepartmentMaster department, SubDepartmentMaster subDepartment, DesignationMaster designational) {
        this.eId = eId;
        this.eCode = eCode;
        this.eFName = eFName;
        this.eMName = eMName;
        this.eLName = eLName;
        this.eAddress1 = eAddress1;
        this.eAddress2 = eAddress2;
        this.eGender = eGender;
        this.ePhoneHome = ePhoneHome;
        this.eMobile = eMobile;
        this.eDoj = eDoj;
        this.status = status;
        this.department = department;
        this.subDepartment = subDepartment;
        this.designational = designational;
    }

    public DesignationMaster getDesignational() {
        return designational;
    }

    public boolean iseGender() {
        return eGender;
    }

    public void setDesignational(DesignationMaster designational) {
        this.designational = designational;
    }

    public DepartmentMaster getDepartment() {
        return department;
    }

    public void setDepartment(DepartmentMaster department) {
        this.department = department;
    }

    public SubDepartmentMaster getSubDepartment() {
        return subDepartment;
    }

    public void setSubDepartment(SubDepartmentMaster subDepartment) {
        this.subDepartment = subDepartment;
    }

    public Date geteDoj() {
        return eDoj;
    }

    public void seteDoj(Date eDoj) {
        this.eDoj = eDoj;
    }

    public EmployeeMaster() {
    }

    public int geteId() {
        return eId;
    }

    public void seteId(int eId) {
        this.eId = eId;
    }

    public String geteCode() {
        return eCode;
    }

    public void seteCode(String eCode) {
        this.eCode = eCode;
    }

    public String geteFName() {
        return eFName;
    }

    public void seteFName(String eFName) {
        this.eFName = eFName;
    }

    public String geteMName() {
        return eMName;
    }

    public void seteMName(String eMName) {
        this.eMName = eMName;
    }

    public String geteLName() {
        return eLName;
    }

    public void seteLName(String eLName) {
        this.eLName = eLName;
    }

    public String geteAddress1() {
        return eAddress1;
    }

    public void seteAddress1(String eAddress1) {
        this.eAddress1 = eAddress1;
    }

    public String geteAddress2() {
        return eAddress2;
    }

    public void seteAddress2(String eAddress2) {
        this.eAddress2 = eAddress2;
    }

    public boolean isEGender() {
        return eGender;
    }

    public void seteGender(boolean eGender) {
        this.eGender = eGender;
    }

    public String getePhoneHome() {
        return ePhoneHome;
    }

    public void setePhoneHome(String ePhoneHome) {
        this.ePhoneHome = ePhoneHome;
    }

    public String geteMobile() {
        return eMobile;
    }

    public void seteMobile(String eMobile) {
        this.eMobile = eMobile;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }
}
